package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaUserMapper;
import com.ruoyi.tea.domain.TeaUser;
import com.ruoyi.tea.service.ITeaUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaUserServiceImpl implements ITeaUserService 
{
    @Autowired
    private TeaUserMapper teaUserMapper;

    /**
     * 查询用户信息
     * 
     * @param id 用户信息主键
     * @return 用户信息
     */
    @Override
    public TeaUser selectTeaUserById(Long id)
    {
        return teaUserMapper.selectTeaUserById(id);
    }

    /**
     * 查询用户信息列表
     * 
     * @param teaUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<TeaUser> selectTeaUserList(TeaUser teaUser)
    {
        return teaUserMapper.selectTeaUserList(teaUser);
    }

    /**
     * 新增用户信息
     * 
     * @param teaUser 用户信息
     * @return 结果
     */
    @Override
    public int insertTeaUser(TeaUser teaUser)
    {
        teaUser.setCreateTime(DateUtils.getNowDate());
        return teaUserMapper.insertTeaUser(teaUser);
    }

    /**
     * 修改用户信息
     * 
     * @param teaUser 用户信息
     * @return 结果
     */
    @Override
    public int updateTeaUser(TeaUser teaUser)
    {
        return teaUserMapper.updateTeaUser(teaUser);
    }

    /**
     * 批量删除用户信息
     * 
     * @param ids 需要删除的用户信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaUserByIds(String ids)
    {
        return teaUserMapper.deleteTeaUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户信息信息
     * 
     * @param id 用户信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaUserById(Long id)
    {
        return teaUserMapper.deleteTeaUserById(id);
    }
}
